﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;
using System.Xml.Serialization;

namespace Samples.WebService.Models
{
    public class Category
    {
        public string Uri { get; set; }
        public int CategoryId { get; set; }
        public string Name { get; set; }

        [XmlIgnore, ScriptIgnore]
        public virtual List<Product> Products { get; set; }

        private static List<Category> _allCategories;
        public static List<Category> AllCategories
        {
            get
            {
                if (_allCategories == null)
                {
                    _allCategories = new List<Category>();
                    var temp = Product.AllProducts;
                }

                return _allCategories;
            }
        }
    }
}